Skip to content

fix(app-shell): AI chat publish seed warning says the pack sentence, not engine text - #35359

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-35303-ai-chat-seed-warn
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-35303-ai-chat-seed-warn

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread
Fixes #35303

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:在 AI 对话页发布草稿时,如果示例数据(seed)载入失败,警告提示的详情行改为语言包里的那句「示例数据未能加载。」,不再显示 seed 载入器的英文内部报错,也不再显示 [object Object]。
  • 为什么改:用中文发布的搭建者会在警告下看到英文引擎文本,或在只有逐行错误时看到 [object Object];console AI build chat: the plan card shows 「已搭建」 when nothing was built, a message sent mid-turn is dropped, the draft preview shows OBJECT_NOT_FOUND, and two cards speak in agent/API terms #32984 的裁决是面向用户的文字只用客户句。首页「全部发布」已由 fix(app-shell): publish-all seed warning says the pack sentence, not engine text #35301 改好,这是同族的第二个入口。
  • 风险与回滚:只改 onPublishDrafts 里警告详情取哪句话,另把引擎文本与错误行原样打到浏览器控制台(console.warn);不动接口、语言键和导出。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/console/ai/AiChatPage.tsx(onPublishDrafts 里 console.ai.seedWarn 那一处 toast);ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.seedWarnPackSentence-35303.test.tsx;.changeset/35303-ai-chat-seed-warn-pack-sentence.md。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/ai/__tests__/AiChatPage.seedWarnPackSentence-35303.test.tsx,预期 6 个用例全绿(en 与 zh-Hans 两种语言)。
  • 需要你做的:无,席位落地。

What changes

AiChatPage's onPublishDrafts warns console.ai.seedWarn when the publish answers seedApplied.success === false. The warning's description used to be seedApplied.error (the seed loader's engine text), else String(seedApplied.errors[0]), which reads [object Object] for a structured { row, reason } row.

The description is now always the pack sentence chatbot.build.health.seedFailed: the sentence the chat's publish-health line says for the same failure and the one Publish all says since #35301 (objectstack#32984 Q1 ruling: user-facing text is the customer sentence, never developer or engine text). The engine text and the error rows go to console.warn('[app-shell] Published, but the seed failed to load:', { packageId, error, errors }), whole, and they still reach the health line's technical details through publishHealthFromResponse, which this diff does not touch.

The changeset is patch on @object-ui/app-shell. No locale keys, props or exports change.

Tests

New file AiChatPage.seedWarnPackSentence-35303.test.tsx, built on the publishAdvisoryReachesAuthor harness (the real handler, useMetadataClient and its client; stubbed sonner, fetch and the chat tree reduced to the button that fires onPublishDrafts), plus I18nProvider with the shipped en and zh-Hans packs. Its own file because I18nProvider installs a module-level i18next global, which would leak into the sibling pin's default-value reads.

  • engine-text arm: a batch whose seedApplied failed with error shows the pack's seedWarn title and seedFailed description; the engine text is absent from the toast and present in the one console.warn line;
  • structured-row arm: a batch whose seedApplied failed with errors: [{ row, reason }] and no error shows the pack sentence, never [object Object]; the row reaches console.warn as an object;
  • CONTROL: a seed that loaded raises no warning, no seed console line, and one publishOk success toast.

Each case runs in en and zh-Hans (6 cases).

Acceptance notes

Verification

All readings at head 09500fa40c.

Ablation: the old description restored on disk, 4 red / 2 green, then restored

The fix was committed first (da8a671). node scripts/ablation-replace.mjs replaced the new description with the old seedApplied.error ?? String(seedApplied.errors[0]) expression: anchor 1 to 0, replacement 0 to 1, blob af4e13d997 to a8bb0a93e9. The subject resolves through source (relative import), so no build sits between the edit and the run.

Expected: "Sample data failed to load."
Received: "seed apply stopped at the seed for object 'crm_task': Reference not found: owner = "ann""
Expected: "示例数据未能加载。"
Received: "[object Object]"
 Test Files  1 failed (1)
      Tests  4 failed | 2 passed (6)
ablation-replace: ok restored: blob == HEAD (af4e13d9971d) and `git diff HEAD` is empty

The 4 failures are the two defect arms in two locales; the 2 passes are the CONTROL cases.

Green on the fixed head
pnpm --dir ui exec vitest run --maxWorkers=2 (new file + publishAdvisoryReachesAuthor)
 Test Files  2 passed (2)
      Tests  9 passed (9)
os-verify-lock: VERDICT command-exit 0

pnpm --dir ui exec vitest run --maxWorkers=2 (console/ai/__tests__/ + the app-shell census and ratchet files that walk sources + the i18n and plugin-chatbot files that read sources)
 Test Files  105 passed (105)
      Tests  1182 passed (1182)
os-verify-lock: VERDICT command-exit 0

pnpm --filter @object-ui/app-shell run type-check (both tsc programs; the new test is in tsconfig.test.json's file list)
os-verify-lock: VERDICT command-exit 0

eslint on the two touched source files: 0 errors (27 pre-existing warnings, none in the edited hunk)
Derived gate families (dispatch-gates --commands, 38 families)

All 38 derived families exited 0, including pnpm --dir ui exec vitest run scripts/ (171 files passed, 2 skipped), check:nul-bytes, check:cross-package-test-inputs, check:test-source-alias, check-empty-changeset, check-adr-0087-registration. Reconciliation: dispatch-gates --ran reports 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN, all with recorded exit codes. overlap-check: merges cleanly with origin/main. check:new-line-citations (ui): 0 new citations.

The full app-shell suite was not run locally; it is left to CI's Test UI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY

Final head for L1: 09500fa40c393acaa05be2852806677e63420441 · 2026-11-19T06:26Z

  • CI on this head: 39 success, 13 skipped, 0 failed or pending. Mergeable state: clean.
  • Diff 301 lines (3 files, mostly the new pin file): above the 50-line self-landing bar, so the L1-a thread reads it. Clause-②: no · Metadata-protocol: none.
  • Same shape as PR fix(app-shell): publish-all seed warning says the pack sentence, not engine text #35301: the toast description is the pack sentence on both arms; engine text and error rows go to console.warn. Pins: both arms + CONTROL in en and zh-Hans; ablation 4 red / 2 CONTROL green, restored blob == HEAD (os-dev report 7001255457).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:在 AI 对话里发布草稿后,如果示例数据没加载上,提示框下面那句说明改成一句正常的、已翻译的话,不再出现引擎内部报错或“[object Object]”。
  • 为什么做:之前提示里直接露出系统内部文字,中文界面下也是英文乱码,用户看不懂。
  • 出错会怎样:只影响这一句说明文字;发布本身和数据加载结果都不变,原始报错仍留在浏览器控制台供排查。
  • 要你做什么:不需要你做任何事,区域审完自己落地。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head 09500fa40c393acaa05be2852806677e63420441 · 2026-11-19T06:28Z

  • 形态 — 3 files, +294/−7 (301 lines), ui/** only. Base 81c09477, main moved K=9 first-parent commits (< 15, no merge needed). check-governed-merges.mjs --pr 35359: not governed, under the 3000-line limit. Clause-②: no, Metadata-protocol: none — no L2 face.
  • Fixes vs card console AI chat: the seed warning after publishing drafts shows the seed loader's engine text, or "[object Object]" #35303 — AiChatPage.tsx publish handler: the console.ai.seedWarn toast description is now t('chatbot.build.health.seedFailed'), replacing seedApplied.error ?? String(seedApplied.errors[0]) (engine text, or [object Object] for a { row, reason } row). The loader's error and errors go to console.warn. The key exists in all 11 packs and is the same sentence Publish-all (usePublishAllDrafts.ts) and the chat health line (ChatbotEnhanced.tsx) show, so the three surfaces now agree. Card "Done when": both arms × en + zh-Hans pinned → met.
  • Changeset — @object-ui/app-shell patch, read sentence by sentence against the diff: the warning title, the old engine-text and [object Object] arms, the new pack sentence and its key, and console.warn for the loader text all match the code. "No locale keys, props or exports change" holds: no locale file, prop or export in the diff.
  • Pins — new __tests__/AiChatPage.seedWarnPackSentence-35303.test.tsx: it.each(['en','zh-Hans']) for the engine-text arm and the structured-row arm (asserts the pack sentence from the real packs, and no [object Object]), plus a control that a seed that loaded shows no warning. There is no shared AiChatPage harness file (the family is per-card files), so a new file is the convention.
  • 门禁 — 52 check-runs on this head: 39 success, 13 skipped (core/docs/opt-in jobs path-filtered out), 0 failure. Mergeable clean.
  • 接受的偏差 — none.
  • 范围外去向 — none found.
  • 落地条款 — not governed: ux-1 lands this head after this ACCEPT. A new push needs a fresh L1 only if it changes more than a main merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbSphdunq2aJq7ktuY

Landing · area ux-1 · 2026-11-19T06:29Z

Reading Value
check-governed-merges --pr 35359 not governed, 301 lines → ordinary queue landing
K (merge base..origin/main, first-parent) 10 (< 15)

ACCEPT 7001653966 (L1-a) at head 09500fa40c393acaa05be2852806677e63420441. Ready + auto-merge now. #35303 closes on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 06:30
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 3e7feed Nov 19, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35303-ai-chat-seed-warn branch November 19, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console AI chat: the seed warning after publishing drafts shows the seed loader's engine text, or "[object Object]"

2 participants